Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakout parameters for x.509 certificate login #4463

Merged
merged 7 commits into from
May 25, 2018

Conversation

nicholasjackson
Copy link
Contributor

@nicholasjackson nicholasjackson commented Apr 26, 2018

This pull requests breaks out the the allowed_names parameter for restricting a certificate into three separate parameters:

  • allowed_common_names
  • allowed_dns
  • allowed_emails

The existing allowed_names parameter still exists however it has also been marked as deprecated in both the documentation and CLI. @jefferai I made an assumption on this if you do not intend to eventually remove the allowed_names I can updated the docs.

This pull request also includes my previous commit to add URI SAN validation, before starting this I rebased master so everything should be up to date.

@jefferai
Copy link
Member

Can you change allowed_dns to allowed_dns_names (or allowed_dns_sans or something similar)? allowed_dns could be interpreted to mean "allowed DNs", as in, the full unique IDs of a given cert.

@nicholasjackson
Copy link
Contributor Author

Hey @jefferai I think allowed_dns_sans is more descriptive, would it make sense to name all these with the same convention so:

  • allowed_dns_sans
  • allowed_uri_sans
  • allowed_email_sans

@nicholasjackson
Copy link
Contributor Author

@jefferai sorry for the delay on the updates to this, I have been traveling and then managed to catch flu. The latest commit updates things to clearly define the additional parameters as being part of the SAN extension as discussed in previous comments.

@jefferai jefferai added this to the 0.10.2 milestone May 19, 2018
@@ -72,6 +73,11 @@ func (b *backend) pathLogin(ctx context.Context, req *logical.Request, data *fra
return nil, nil
}

ttl := matched.Entry.TTL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for this and the other TTL bits below? AFAICT this is readding old code that was removed.

@@ -324,7 +422,7 @@ func (b *backend) loadTrustedCerts(ctx context.Context, storage logical.Storage,
trustedNonCAs = make([]*ParsedCert, 0)
names, err := storage.List(ctx, "cert/")
if err != nil {
b.Logger().Error("failed to list trusted certs", "error", err)
b.Logger().Error("cert: failed to list trusted certs", "error", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you adding this back in?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with the other logging statements below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jefferai I have no idea on that, I wonder if I had an old branch, pretty sure I just extended my previous pull request, might not have had changes from master applied, let me double check the Sha's

@jefferai
Copy link
Member

@nicholasjackson I removed the old stuff that had crept in. Something I can't do easily since this is on your fork instead of the main repo: Can you s/Sans/SANs?

@nicholasjackson
Copy link
Contributor Author

@jefferai 100%, I will do this first thing tomorrow morning, so this will be ready for you tomorrow

@jefferai
Copy link
Member

Looks great! Thank you!

@jefferai jefferai merged commit 61e0eda into hashicorp:master May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants